package com.sishuok.springstudy;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import com.sishuok.springstudy.aop.MyService;

@Component
//@EnableAspectJAutoProxy
public class HelloSpring {
	public static void main(String[] args) {
		ApplicationContext context = 
	             new ClassPathXmlApplicationContext("applicationContext.xml");
//		HelloSpring hello = context.getBean(HelloSpring.class);
//		System.out.println("hello==="+hello);
//		
//		UserModel um = (UserModel)context.getBean("myFactoryBean");
//		System.out.println("um==="+um);
////
//		MyFactoryBean myFactoryBean = (MyFactoryBean)context.getBean("&myFactoryBean");
//		System.out.println("myFactoryBean==="+myFactoryBean);
		
		MyService ms = (MyService)context.getBean("myService");
		ms.t1();
//
	}
}